package com.lee;

import java.util.Random;
import java.util.Scanner;

public class HelloWorld {


    public static void main(String[] args) {
//        String code = genVerifyCode(5);
//        System.out.println(code);
//
//        System.out.println(genVerifyCode(10));
//        buyTicket();
        sushu();
    }


    public static String genVerifyCode(int len) {
        String codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklnmopqrstuvwxyz0123456789";
        Random random = new Random();

        String result = "";
        for (int i = 0; i < len; i++) {
            int index = random.nextInt(codes.length());
            result += codes.charAt(index);
        }
        return result;
    }

    public static void buyTicket() {
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("请输入机票原价格：");
            Double price = sc.nextDouble();
            System.out.println("请输入座位类型（头等舱 0，经济舱 1）：");
            int seat = sc.nextInt();
            System.out.println("请输入出行的月份：");
            int month = sc.nextInt();

            switch (month) {
                case 11:
                case 12:
                case 1:
                case 2:
                case 3:
                case 4:
                    //  头等舱
                    if (seat == 0) {
                        price = price * 0.9;
                    } else {
                        price = price * 0.85;
                    }
                    break;
                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                case 10:
                    //  头等舱
                    if (seat == 0) {
                        price = price * 0.7;
                    } else {
                        price = price * 0.65;
                    }
                    break;
            }
            System.out.println("查询结果：该机票在" + month + "月份大概的费用为：" + price + "元");
        }
    }

    public static void sushu() {
        String res = "";
        for (int i = 101; i < 200; i++) {
            boolean flag = true;
            for (int j = 2; j < (i >> 2); j++) {
                if (i % j == 0) {
                    flag = false;
                    break;
                }
            }
            if (flag) {
                res += i + " ";
            }
        }
        System.out.println(res);
    }

    /**
     *  第一个月有1对兔子，当兔子成长到三月个就成年，可以在生再1对小兔子，当小兔子成长到三个月也成年，也可以在生出一对兔子，
     *  如果兔子都不死，问第20个月一共有多少只兔子
     *  1 1 1 1 1
     *      1 1 1
     *        1 1
     *          1
     *          1
     *
     *
     *
     */
    public static void rabit() {



    }
}
